package com.zyf.chapter02.creation.singleton;

import java.io.IOException;

/**
 * 使用 Logger
 * @author yifeng
 */
public class Controller {
    public static class UserController {
        private Logger logger = new Logger();

        public UserController() throws IOException {
        }

        public void login(String username, String password) throws IOException {
            // .. 省略业务代码
            logger.log(username + " logined!");
        }
    }

    public static class OrderController {
        private Logger logger = new Logger();

        public OrderController() throws IOException {
        }

        public void login(String username, String password) throws IOException {
            // .. 省略业务代码
            logger.log(username + " logined!");
        }
    }
}
